<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use App\Admin\Auth\AdminUserController;
use App\Admin\Auth\NodesController;
use App\Admin\Auth\RolesController;
use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'admin', 'namespace' => 'Admin'],function() {

	Route::get('/', [AdminUserController::class, 'index'])->name('index.index');
	Route::get('login', [LoginController::class, 'index'])->name('login.index');
	
	// 管理员路由
	Route::get('adminUser', [AdminUserController::class, 'index'])->name('adminUser.index');
	Route::get('adminUser/edit/{id?}', [AdminUserController::class, 'edit'])->name('adminUser.edit');
	Route::post('adminUser/save', [AdminUserController::class, 'save'])->name('adminUser.save');
	Route::post('adminUser/get_list', [AdminUserController::class, 'getList'])->name('adminUser.getList');
	Route::delete('adminUser/delete/{id}', [AdminUserController::class, 'delete'])->name('adminUser.delete');

	// 节点路由
	Route::get('nodes', [NodesController::class, 'index'])->name('nodes.index');
	Route::get('nodes/get_list', [NodesController::class, 'getList'])->name('nodes.getList');
	Route::post('nodes/save', [NodesController::class, 'save'])->name('nodes.save');
	Route::get('nodes/edit/{pid}/{id?}', [NodesController::class, 'edit'])->name('nodes.edit');
	Route::delete('nodes/delete/{id}', [NodesController::class, 'delete'])->name('nodes.delete');

	// 角色路由
	Route::get('roles', [RolesController::class, 'index'])->name('roles.index');
	Route::get('roles/get_list', [RolesController::class, 'getList'])->name('roles.getList');
	Route::post('roles/save', [RolesController::class, 'save'])->name('roles.save');
	Route::get('roles/edit/{id?}', [RolesController::class, 'edit'])->name('roles.edit');
	Route::delete('roles/delete/{id}', [RolesController::class, 'delete'])->name('roles.delete');
	Route::get('roles/edit_auth/{id}', [RolesController::class, 'editAuth'])->name('roles.editAuth');
	Route::post('roles/auth_save', [RolesController::class, 'authSave'])->name('role.authSave');

});

